package com.jming.jike.dto.front;

import com.jming.jike.common.ValidatorGroup.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Pattern;

/**
 * @author jinming.zhang
 * @version 0.0.1
 * @date 2022/05/31
 */
@Data
public class UserDTO {


    @ApiModelProperty("姓名")
    @Length(max = 10, message = "备注不能超过{max}个字符", groups = {Update.class})
    private String name;

    @ApiModelProperty("手机号")
    @Pattern(regexp = "[0-9-()（）]{7,18}", message = "手机号格式不正确", groups = {Update.class})
    private String phone;

    @ApiModelProperty("验证码 (未修改手机号则不传)")
    private String code;

    @ApiModelProperty("性别")
    private String sex;

    @ApiModelProperty("身份证号")
    @Pattern(regexp = "\\d{17}[\\d|x]|\\d{15}", message = "身份证号格式不正确", groups = {Update.class})
    private String idNumber;

    @ApiModelProperty("头像")
    private String avatar;

    @ApiModelProperty("头像地址")
    private String avatarUrl;

}
